package com.geostar.constructionland.analyse.service;

import com.geostar.constructionland.analyse.controller.AnalyseController;
import com.geostar.constructionland.analyse.entity.model.AnalyseModel;
import com.geostar.constructionland.common.dao.LogMongoSptDao;
import com.geostar.constructionland.common.global.AnalyseType;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.UUID;

/**
 * @author yelll
 * @since 2020-5-28 17:05
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
@Slf4j
public class TAnalyseService {
    @Autowired
    AnalyseService analyseService;
    @Autowired
    LogMongoSptDao logMongoSptDao;
    @Autowired
    private AnalyseController analyseController;

    @Test
    public void analyseTest() throws Exception {
        String fxlx = "TZHDLFXVer2.0";
        String[] fxlxs = fxlx.split("Ver");
        System.out.println(fxlxs.length);
        System.out.println(fxlxs[0]);
        System.out.println(fxlxs[1]);
    }

    @Test
    public void testAnalyseValid() throws Exception {
        AnalyseModel analyseModel = new AnalyseModel();
        analyseModel.setAdjustVersion("1.0");
        analyseModel.setAnalyseVersion("2.0");
        analyseModel.setDlnd("2018");
        analyseModel.setFxlx(AnalyseType.LYFWFX.getCode());
        analyseModel.setGdnd("2016");
        analyseModel.setQsnd("202006");
        analyseModel.setYwid("78d2ce38351c4d2bafb6c53506391d21");
        analyseModel.setAlyId(UUID.randomUUID().toString().replaceAll("-", ""));
        analyseController.analyse(analyseModel);
    }
}
